<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
     <div id="app">
        <ul>
            <li v-for="(item,index) of arrXiao" :key="index">
                {{item}}
            </li>
        </ul>
     </div>
    <script src='https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js'></script>
    <script>
        //vue2中千万不要把v-for和v-if放在同一个组件上
        //会带来性能问题
        //转换成计算属性
        //vue3 v-if要比v-for优先级别高
        const vm =new Vue({
             el:"#app",
             data:{
                 arr:["小猫","小狗","oao","大鱼海棠"]
             },
             computed:{
                arrXiao(){
                    return  this.arr.filter((item)=>{
                       return  item !== "小狗"
                    })
                }
             },
             methods: {
                 add(){
                    console.log("ds")
                 }
             }
        })
    </script>
</body>
</html>